//index.js
const app = getApp()

Page({
  data: {
    img: [{
      img: 'http://sd.offcn.com/zg/wximg/2021/guoshengkao/newban.jpg',
      bind: 'newban'
    }],
    navbarArr: [{
        pic_url: 'http://sd.offcn.com/zg/wximg/2021/sk/index/icon1.png',
        viewNavto: 'icon1',
        name: '晒分查分差'
      },
      {
        pic_url: 'http://sd.offcn.com/zg/wximg/2021/sk/index/icon2.png',
        viewNavto: 'icon2',
        name: '往年面试分'
      },
      {
        pic_url: 'http://sd.offcn.com/zg/wximg/2021/sk/index/icon3.png',
        viewNavto: 'icon3',
        name: '面试考题'
      },
      {
        pic_url: 'http://sd.offcn.com/zg/wximg/2021/sk/index/icon4.png',
        viewNavto: 'icon4',
        name: '面试模拟题'
      },
      {
        pic_url: 'http://sd.offcn.com/zg/wximg/2021/sk/index/icon5.png',
        viewNavto: 'icon5',
        name: '重要讲话'
      },
      {
        pic_url: 'http://sd.offcn.com/zg/wximg/2021/sk/index/icon6.png',
        viewNavto: 'icon6',
        name: '面试金句'
      },
      {
        pic_url: 'http://sd.offcn.com/zg/wximg/2021/sk/index/icon7.png',
        viewNavto: 'icon7',
        name: '热点素材'
      },
      {
        pic_url: 'http://sd.offcn.com/zg/wximg/2021/sk/index/icon8.png',
        viewNavto: 'icon8',
        name: '面试考情'
      },
    ],
    theSwiper: [{
        src: 'http://sd.offcn.com/zg/wximg/gkhz-img/new.jpg',
        tomini: 'tozx'
      },
      {
        src: 'http://sd.offcn.com/zg/wximg/gkhz-img/banner_2.jpg',
        tomini: 'tozx'
      },
      {
        src: 'http://sd.offcn.com/zg/wximg/gkhz-img/banner_3.jpg',
        tomini: 'togkbs'
      },
      {
        src: 'http://sd.offcn.com/zg/wximg/gkhz-img/banner_4.jpg',
        tomini: 'to19'
      }
    ],
    indicatorDots: true,
    vertical: false,
    autoplay: true,
    interval: 3000,
    duration: 1500,
    current: 0,
    area: '默认',
    geneal: '默认'
  },
  banner1: function () {
    wx.navigateTo({
      url: '../out/skmdm/skmdm',
    })
  },
  banner2: function () {
    wx.navigateToMiniProgram({
      appId: 'wxca86930ec3e80717',
      path: 'page/course/details?scode=&id=359751',
      envVersion: 'release', // 打开正式版

    })
  },
  banner3: function () {
    wx.navigateTo({
      url: '../out/skbs/skbs',
    })
  },
  newban: function () {
    wx.navigateTo({
      url: '../out/banner1/banner1',
    })
  },
  icon1: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    // wx.navigateToMiniProgram({
    //   appId: 'wx2509acc672d530e5', //国考职位查询小程序appid
    //   path: 'pages/shaifen/index/index?area=' + area + '&agent=' + agent + '&page=' + page,
    //   envVersion: 'release', //develop（开发版），trial（体验版），release（正式版） 
    //   success(res) {
    //     console.log('打开成功！')
    //   }
    // })
    wx.navigateTo({
      url: '../shaifen/index/index?area=' + area + '&agent=' + agent + '&page=' + page,
    })
  },
  icon2: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    wx.navigateTo({
      url: '../stcx/index/index?area=' + area + '&agent=' + agent + '&page=' + page
    })
  },
  icon3: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    wx.navigateTo({
      url: '../booklist1/booslist?area=' + area + '&agent=' + agent + '&page=' + page
    })
  },
  icon4: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    wx.navigateTo({
      url: '../booklist1/booslist?area=' + area + '&agent=' + agent + '&page=' + page
    })
  },
  icon5: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    wx.navigateTo({
      url: '../booklist/booslist?area=' + area + '&agent=' + agent + '&page=' + page
    })
  },
  icon6: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    wx.navigateTo({
      url: '../booklist/booslist?area=' + area + '&agent=' + agent + '&page=' + page
    })
  },
  icon7: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    wx.navigateTo({
      url: '../booklist/booslist?area=' + area + '&agent=' + agent + '&page=' + page
    })
  },
  icon8: function () {
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')

    wx.navigateTo({
      url: '../booklist/booslist?area=' + area + '&agent=' + agent + '&page=' + page
    })
  },
  link1: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    wx.navigateToMiniProgram({
      appId: 'wxca86930ec3e80717', //国考职位查询小程序appid
      path: 'page/course/details?id=359751',
      envVersion: 'release', //develop（开发版），trial（体验版），release（正式版） 
      success(res) {
        console.log('打开成功！')
      }
    })
  },
  link2: function () {
    wx.navigateToMiniProgram({
      appId: 'wxca86930ec3e80717', //国考职位查询小程序appid
      path: 'page/course/details?id=359751',
      envVersion: 'release', //develop（开发版），trial（体验版），release（正式版） 
      success(res) {
        console.log('打开成功！')
      }
    })
  },
  link11: function () {
    wx.navigateTo({
      url: '../out/y1/y1'
    })
  },
  link12: function () {
    wx.navigateTo({
      url: '../out/y2/y2'
    })
  },
  link13: function () {
    wx.navigateTo({
      url: '../out/y3/y3'
    })
  },
  link14: function () {
    wx.navigateTo({
      url: '../out/y4/y4'
    })
  },


  toxiaoneng: function () {
    wx.navigateTo({
      url: '../xiaoneng/xiaoneng'
    })
  },
  toshijuan: function () {
    wx.navigateToMiniProgram({
      appId: 'wx3bfce5135e23ad3f', //国考职位查询小程序appid
      path: 'pages/search/search/search?area=' + _.data.area + '&agent=' + _.data.agent + '&page=' + _.data.page, //国考职位查询首页index
      envVersion: 'release', //develop（开发版），trial（体验版），release（正式版） 
      success(res) {
        console.log('打开成功！')
      }
    })
  },
  onLoad: function (options) {
    var _ = this;
  },
 
  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    return {
      title: '2023山东省省考百宝箱',
      path: 'pages/sk/index/index?area=' + area + '&agent=' + agent + '&page=' + page
    }

  },
  /**分享到朋友圈*/
  onShareTimeline: function () {
    var _ = this;
    var area = wx.getStorageSync('area')
    var agent = wx.getStorageSync('agent')
    var page = wx.getStorageSync('page')
    return {
      title: '2023山东省省考百宝箱',
      path: 'pages/sk/index/index?area=' + area + '&agent=' + agent + '&page=' + page
    }
  }


})